Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Repl has been set to read only mode to prevent accidental deletes, configurable through CLI flag.
Delete operation must be confirmed with a yes/no
Finishing up the great work started in #100
Functional test / demo:
$ go run cmd/topicctl/main.go delete Deletes instances of a particular type. Usage: topicctl delete [command] Available Commands: topic Delete a topic Flags: -b, --broker-addr string Broker address --cluster-config string Cluster config --expand-env Expand environment in cluster config -h, --help help for delete --sasl-mechanism string SASL mechanism if using SASL (choices: AWS-MSK-IAM, PLAIN, SCRAM-SHA-256, or SCRAM-SHA-512) --sasl-password string SASL password if using SASL; will override value set in cluster config --sasl-username string SASL username if using SASL; will override value set in cluster config --tls-ca-cert string Path to client CA cert PEM file if using TLS --tls-cert string Path to client cert PEM file if using TLS --tls-enabled Use TLS for communication with brokers --tls-key string Path to client private key PEM file if using TLS --tls-server-name string Server name to use for TLS cert verification --tls-skip-verify Skip hostname verification when using TLS -z, --zk-addr string ZooKeeper address --zk-prefix string Prefix for cluster-related nodes in zk Global Flags: --debug enable debug logging --no-spinner disable all UI spinners Use "topicctl delete [command] --help" for more information about a command. $ go run cmd/topicctl/main.go get topics --cluster-config examples/local-cluster/cluster.yaml [2023-11-09 10:41:13] INFO Topics: -----------------+------------+-------------+-----------+------------ NAME | PARTITIONS | REPLICATION | RETENTION | RACKS | | | MINS | (MIN,MAX) -----------------+------------+-------------+-----------+------------ topic-default | 3 | 2 | 100 | (1,1) topic-in-rack3 | 9 | 2 | 100 | (1,1) topic-static | 10 | 2 | 290 | (1,2) -----------------+------------+-------------+-----------+----------- $ go run cmd/topicctl/main.go delete topic topic-default --cluster-config examples/local-cluster/cluster.yaml [2023-11-09 10:41:47] INFO Checking if topic topic-default exists... [2023-11-09 10:41:47] INFO Topic topic-default exists in the cluster! Delete topic "topic-default" (yes/no) yes [2023-11-09 10:41:51] INFO Topic topic-default successfully deleted $ go run cmd/topicctl/main.go get topics --cluster-config examples/local-cluster/cluster.yaml [2023-11-09 10:41:56] INFO Topics: -----------------+------------+-------------+-----------+------------ NAME | PARTITIONS | REPLICATION | RETENTION | RACKS | | | MINS | (MIN,MAX) -----------------+------------+-------------+-----------+------------ topic-in-rack3 | 9 | 2 | 100 | (1,1) topic-static | 10 | 2 | 290 | (1,2) -----------------+------------+-------------+-----------+------------